import request from '@/utils/request'


//导入数据
export function importExcel(data) {
  return request({
    url: '/dashboard/excel',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

//导入模板
export function exportctTemplate() {
  return request({
    url: '/dashboard/template',
    method: 'get',
    responseType: 'blob'  // 关键：必须指定响应类型为blob
  })
}

//查询数据
export function querytable(pageNum, pageSize, year, month, line) {
  return request({
    url: '/dashboard/querytable',
    method: 'post',
    data: {
      pageNum: pageNum,
      pageSize: pageSize,
      year: year,
      month: month,
      line: line
    }
  })
}

//导出Excel
export function dashboardExport() {
  return request({
    url: '/dashboard/export',
    method: 'post',
    responseType: 'blob',
  })
}